package com.pearadmin.hospital.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pearadmin.hospital.mapper.HospitalBillinfoMapper;
import com.pearadmin.hospital.domain.HospitalBillinfo;
import com.pearadmin.hospital.service.IHospitalBillinfoService;

/**
 * 账单信息Service业务层处理
 * 
 * @author yuan
 * @date 2021-07-29
 */
@Service
public class HospitalBillinfoServiceImpl implements IHospitalBillinfoService 
{
    @Autowired
    private HospitalBillinfoMapper hospitalBillinfoMapper;

    /**
     * 查询账单信息
     * 
     * @param id 账单信息ID
     * @return 账单信息
     */
    @Override
    public HospitalBillinfo selectHospitalBillinfoById(Integer id)
    {
        return hospitalBillinfoMapper.selectHospitalBillinfoById(id);
    }

    /**
     * 查询账单信息列表
     * 
     * @param hospitalBillinfo 账单信息
     * @return 账单信息
     */
    @Override
    public List<HospitalBillinfo> selectHospitalBillinfoList(HospitalBillinfo hospitalBillinfo)
    {
        return hospitalBillinfoMapper.selectHospitalBillinfoList(hospitalBillinfo);
    }

    /**
     * 查询账单信息
     * @param hospitalBillinfo 账单信息
     * @param pageDomain
     * @return 账单信息 分页集合
     * */
    @Override
    public PageInfo<HospitalBillinfo> selectHospitalBillinfoPage(HospitalBillinfo hospitalBillinfo, PageDomain pageDomain)
    {
        PageHelper.startPage(pageDomain.getPage(),pageDomain.getLimit());
        List<HospitalBillinfo> data = hospitalBillinfoMapper.selectHospitalBillinfoList(hospitalBillinfo);
        return new PageInfo<>(data);
    }

    /**
     * 新增账单信息
     * 
     * @param hospitalBillinfo 账单信息
     * @return 结果
     */

    @Override
    public int insertHospitalBillinfo(HospitalBillinfo hospitalBillinfo)
    {
        return hospitalBillinfoMapper.insertHospitalBillinfo(hospitalBillinfo);
    }

    /**
     * 修改账单信息
     * 
     * @param hospitalBillinfo 账单信息
     * @return 结果
     */
    @Override
    public int updateHospitalBillinfo(HospitalBillinfo hospitalBillinfo)
    {
        return hospitalBillinfoMapper.updateHospitalBillinfo(hospitalBillinfo);
    }

    /**
     * 删除账单信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteHospitalBillinfoByIds(String[] ids)
    {
        return hospitalBillinfoMapper.deleteHospitalBillinfoByIds(ids);
    }

    /**
     * 删除账单信息信息
     * 
     * @param id 账单信息ID
     * @return 结果
     */
    @Override
    public int deleteHospitalBillinfoById(Integer id)
    {
        return hospitalBillinfoMapper.deleteHospitalBillinfoById(id);
    }
}
